Optimal. Leaf size=205 \[ \frac {\log \left (a+b x+c x^2\right ) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )}{2 c^3}+\frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )-2 c^2 \left (-a A e^2-2 a B d e+A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {e x (A c e-b B e+2 B c d)}{c^2}+\frac {B e^2 x^2}{2 c} \]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {800, 634, 618, 206, 628} \begin {gather*} \frac {\log \left (a+b x+c x^2\right ) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )}{2 c^3}+\frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )-2 c^2 \left (-a A e^2-2 a B d e+A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {e x (A c e-b B e+2 B c d)}{c^2}+\frac {B e^2 x^2}{2 c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 800
Rubi steps
\begin {align*} \int \frac {(A+B x) (d+e x)^2}{a+b x+c x^2} \, dx &=\int \left (\frac {e (2 B c d-b B e+A c e)}{c^2}+\frac {B e^2 x}{c}+\frac {-a B e (2 c d-b e)+A c \left (c d^2-a e^2\right )+\left (A c e (2 c d-b e)+B \left (c^2 d^2+b^2 e^2-c e (2 b d+a e)\right )\right ) x}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac {e (2 B c d-b B e+A c e) x}{c^2}+\frac {B e^2 x^2}{2 c}+\frac {\int \frac {-a B e (2 c d-b e)+A c \left (c d^2-a e^2\right )+\left (A c e (2 c d-b e)+B \left (c^2 d^2+b^2 e^2-c e (2 b d+a e)\right )\right ) x}{a+b x+c x^2} \, dx}{c^2}\\ &=\frac {e (2 B c d-b B e+A c e) x}{c^2}+\frac {B e^2 x^2}{2 c}-\frac {\left (b^3 B e^2-b^2 c e (2 B d+A e)-2 c^2 \left (A c d^2-2 a B d e-a A e^2\right )+b c \left (B c d^2+2 A c d e-3 a B e^2\right )\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c^3}+\frac {\left (A c e (2 c d-b e)+B \left (c^2 d^2+b^2 e^2-c e (2 b d+a e)\right )\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c^3}\\ &=\frac {e (2 B c d-b B e+A c e) x}{c^2}+\frac {B e^2 x^2}{2 c}+\frac {\left (A c e (2 c d-b e)+B \left (c^2 d^2+b^2 e^2-c e (2 b d+a e)\right )\right ) \log \left (a+b x+c x^2\right )}{2 c^3}+\frac {\left (b^3 B e^2-b^2 c e (2 B d+A e)-2 c^2 \left (A c d^2-2 a B d e-a A e^2\right )+b c \left (B c d^2+2 A c d e-3 a B e^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^3}\\ &=\frac {e (2 B c d-b B e+A c e) x}{c^2}+\frac {B e^2 x^2}{2 c}+\frac {\left (b^3 B e^2-b^2 c e (2 B d+A e)-2 c^2 \left (A c d^2-2 a B d e-a A e^2\right )+b c \left (B c d^2+2 A c d e-3 a B e^2\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {\left (A c e (2 c d-b e)+B \left (c^2 d^2+b^2 e^2-c e (2 b d+a e)\right )\right ) \log \left (a+b x+c x^2\right )}{2 c^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.17, size = 203, normalized size = 0.99 \begin {gather*} \frac {\log (a+x (b+c x)) \left (B \left (-c e (a e+2 b d)+b^2 e^2+c^2 d^2\right )+A c e (2 c d-b e)\right )-\frac {2 \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right ) \left (b c \left (-3 a B e^2+2 A c d e+B c d^2\right )+2 c^2 \left (a A e^2+2 a B d e-A c d^2\right )-b^2 c e (A e+2 B d)+b^3 B e^2\right )}{\sqrt {4 a c-b^2}}+2 c e x (A c e-b B e+2 B c d)+B c^2 e^2 x^2}{2 c^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(A+B x) (d+e x)^2}{a+b x+c x^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 673, normalized size = 3.28 \begin {gather*} \left [\frac {{\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} e^{2} x^{2} + {\left ({\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2} - 2 \, {\left (B b^{2} c - {\left (2 \, B a + A b\right )} c^{2}\right )} d e + {\left (B b^{3} + 2 \, A a c^{2} - {\left (3 \, B a b + A b^{2}\right )} c\right )} e^{2}\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 2 \, {\left (2 \, {\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} d e - {\left (B b^{3} c + 4 \, A a c^{3} - {\left (4 \, B a b + A b^{2}\right )} c^{2}\right )} e^{2}\right )} x + {\left ({\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} d^{2} - 2 \, {\left (B b^{3} c + 4 \, A a c^{3} - {\left (4 \, B a b + A b^{2}\right )} c^{2}\right )} d e + {\left (B b^{4} + 4 \, {\left (B a^{2} + A a b\right )} c^{2} - {\left (5 \, B a b^{2} + A b^{3}\right )} c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}, \frac {{\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} e^{2} x^{2} + 2 \, {\left ({\left (B b c^{2} - 2 \, A c^{3}\right )} d^{2} - 2 \, {\left (B b^{2} c - {\left (2 \, B a + A b\right )} c^{2}\right )} d e + {\left (B b^{3} + 2 \, A a c^{2} - {\left (3 \, B a b + A b^{2}\right )} c\right )} e^{2}\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left (2 \, {\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} d e - {\left (B b^{3} c + 4 \, A a c^{3} - {\left (4 \, B a b + A b^{2}\right )} c^{2}\right )} e^{2}\right )} x + {\left ({\left (B b^{2} c^{2} - 4 \, B a c^{3}\right )} d^{2} - 2 \, {\left (B b^{3} c + 4 \, A a c^{3} - {\left (4 \, B a b + A b^{2}\right )} c^{2}\right )} d e + {\left (B b^{4} + 4 \, {\left (B a^{2} + A a b\right )} c^{2} - {\left (5 \, B a b^{2} + A b^{3}\right )} c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 219, normalized size = 1.07 \begin {gather*} \frac {B c x^{2} e^{2} + 4 \, B c d x e - 2 \, B b x e^{2} + 2 \, A c x e^{2}}{2 \, c^{2}} + \frac {{\left (B c^{2} d^{2} - 2 \, B b c d e + 2 \, A c^{2} d e + B b^{2} e^{2} - B a c e^{2} - A b c e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} - \frac {{\left (B b c^{2} d^{2} - 2 \, A c^{3} d^{2} - 2 \, B b^{2} c d e + 4 \, B a c^{2} d e + 2 \, A b c^{2} d e + B b^{3} e^{2} - 3 \, B a b c e^{2} - A b^{2} c e^{2} + 2 \, A a c^{2} e^{2}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.05, size = 543, normalized size = 2.65 \begin {gather*} -\frac {2 A a \,e^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}+\frac {A \,b^{2} e^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}-\frac {2 A b d e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}+\frac {2 A \,d^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}+\frac {3 B a b \,e^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}-\frac {4 B a d e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}-\frac {B \,b^{3} e^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{3}}+\frac {2 B \,b^{2} d e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}-\frac {B b \,d^{2} \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}+\frac {B \,e^{2} x^{2}}{2 c}-\frac {A b \,e^{2} \ln \left (c \,x^{2}+b x +a \right )}{2 c^{2}}+\frac {A d e \ln \left (c \,x^{2}+b x +a \right )}{c}+\frac {A \,e^{2} x}{c}-\frac {B a \,e^{2} \ln \left (c \,x^{2}+b x +a \right )}{2 c^{2}}+\frac {B \,b^{2} e^{2} \ln \left (c \,x^{2}+b x +a \right )}{2 c^{3}}-\frac {B b d e \ln \left (c \,x^{2}+b x +a \right )}{c^{2}}-\frac {B b \,e^{2} x}{c^{2}}+\frac {B \,d^{2} \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 B d e x}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.78, size = 316, normalized size = 1.54 \begin {gather*} x\,\left (\frac {A\,e^2+2\,B\,d\,e}{c}-\frac {B\,b\,e^2}{c^2}\right )-\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (4\,B\,a^2\,c^2\,e^2-5\,B\,a\,b^2\,c\,e^2+8\,B\,a\,b\,c^2\,d\,e+4\,A\,a\,b\,c^2\,e^2-4\,B\,a\,c^3\,d^2-8\,A\,a\,c^3\,d\,e+B\,b^4\,e^2-2\,B\,b^3\,c\,d\,e-A\,b^3\,c\,e^2+B\,b^2\,c^2\,d^2+2\,A\,b^2\,c^2\,d\,e\right )}{2\,\left (4\,a\,c^4-b^2\,c^3\right )}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (B\,b^3\,e^2-2\,B\,b^2\,c\,d\,e-A\,b^2\,c\,e^2+B\,b\,c^2\,d^2+2\,A\,b\,c^2\,d\,e-3\,B\,a\,b\,c\,e^2-2\,A\,c^3\,d^2+4\,B\,a\,c^2\,d\,e+2\,A\,a\,c^2\,e^2\right )}{c^3\,\sqrt {4\,a\,c-b^2}}+\frac {B\,e^2\,x^2}{2\,c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 11.09, size = 1532, normalized size = 7.47 \begin {gather*} \frac {B e^{2} x^{2}}{2 c} + x \left (\frac {A e^{2}}{c} - \frac {B b e^{2}}{c^{2}} + \frac {2 B d e}{c}\right ) + \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right ) \log {\left (x + \frac {A a b c e^{2} - 4 A a c^{2} d e + A b c^{2} d^{2} + 2 B a^{2} c e^{2} - B a b^{2} e^{2} + 2 B a b c d e - 2 B a c^{2} d^{2} + 4 a c^{3} \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right ) - b^{2} c^{2} \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right )}{- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}} \right )} + \left (\frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right ) \log {\left (x + \frac {A a b c e^{2} - 4 A a c^{2} d e + A b c^{2} d^{2} + 2 B a^{2} c e^{2} - B a b^{2} e^{2} + 2 B a b c d e - 2 B a c^{2} d^{2} + 4 a c^{3} \left (\frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right ) - b^{2} c^{2} \left (\frac {\sqrt {- 4 a c + b^{2}} \left (- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}\right )}{2 c^{3} \left (4 a c - b^{2}\right )} - \frac {A b c e^{2} - 2 A c^{2} d e + B a c e^{2} - B b^{2} e^{2} + 2 B b c d e - B c^{2} d^{2}}{2 c^{3}}\right )}{- 2 A a c^{2} e^{2} + A b^{2} c e^{2} - 2 A b c^{2} d e + 2 A c^{3} d^{2} + 3 B a b c e^{2} - 4 B a c^{2} d e - B b^{3} e^{2} + 2 B b^{2} c d e - B b c^{2} d^{2}} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________